#include <stdio.h>
#define N 10
void avg_sum(double a[], int n, double *avg, double *sum);
int main(void)
{
    double a[N] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
    double avg, sum;
    avg_sum(a, N, &avg, &sum);
    printf("AVG: %g\n", avg);
    printf("SUM: %g\n", sum);
    return 0;
}
void avg_sum(double a[], int n, double *avg, double *sum) {
    *sum = 0;
    for (int i = 0; i < n; i++)
        *sum += a[i];
    *avg = *sum / n;
}